import React from 'react';
import Loadable from '@/components/Loadable';
import type { MenuRouteObject } from '@/types/router';
import CommonPage from '@/pages/Common';

const NotFoundComponent = Loadable(() => import('@/components/NotFound'));

const CommonLoginPage = Loadable(() => import('@/pages/Common/Login'));

export const commonRoute: MenuRouteObject = {
  title: '公共模块',
  path: 'common',
  fullpath: '/common',
  element: <CommonPage />,
  children: [
    {
      path: 'login',
      fullpath: '/common/login',
      icon: null,
      element: <CommonLoginPage />,
    },
    {
      path: '*',
      element: (
        <NotFoundComponent
          message="页面不存在"
          navigatePath='/common/login'
        />
      ),
    },
  ],
};
